package com.sskj.api.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.time.LocalDateTime;

@Schema(description = "项目设备")
@Data
@TableName("project_device")
public class ProjectDevice {

    @Schema(description = "主键ID")
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    @Schema(description = "项目ID")
    @TableField("project_id")
    @NotNull(message = "项目不能为空")
    private Long projectId;

    @Schema(description = "项目名称")
    @TableField(exist = false)
    private String projectName;

    @Schema(description = "设备ID")
    @TableField("device_id")
    @NotNull(message = "设备不能为空")
    private Long deviceId;

    @Schema(description = "设备编码")
    @TableField(exist = false)
    private String deviceCode;

    @Schema(description = "设备名称")
    @TableField(exist = false)
    private String deviceName;

    @Schema(description = "设备状态")
    @TableField(exist = false)
    private Integer deviceStatus;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
}
